package com.liuujun.idea.toolswindow;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class DemoToolWindowFactory implements ToolWindowFactory {
    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {

        Content content = ContentFactory.getInstance().createContent(
                new JLabel("我是一个小组件....."),
                "",
                false
        );

        toolWindow.getContentManager().addContent(content);
    }
}
